#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	int n,m;
	cin>>n>>m;
	string s1,s2;
	for(int i=1;i<=n+m;i++){
		cin>>s1>>s2;
	}
	for(int i=1;i<=m;i++) cout<<0<<endl;
	return 0;
}
